package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljKeepZongService;
import com.guigu.www.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljKeepZongServlet")
public class LljKeepZongServlet {
    @Autowired
    LljKeepZongService service;
    @GetMapping()
    public PageVo<KeepZong> pageKeepZong(Integer pageNum, Integer pageSize, String keepZongTitle){
        return service.pageKeepZong(pageNum, pageSize, keepZongTitle);
    }
    @PutMapping()
    public void updateKeepZong(Integer foodZongId, Integer keepZongState) {
        service.updateKeepZong(foodZongId, keepZongState);
    }
    @PostMapping()
    public void addfood(@RequestBody KeepZong keepZong, Integer[] tempKeepId){
        service.insertFoodZong(keepZong, tempKeepId);
    }
    @GetMapping("/queryById")
    public List<TemplateKeep> queryById(int keepZongId) {
        return service.queryById(keepZongId);
    }
}
